home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 April
/
Ahoy_Magazine_88-04_1988_Double_L.d64
/
Time Machine 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
714b
|
21 lines
0 print"[147]"tab(13)"time machine"
1 rem =================================
2 rem commodares problem #48-3 :
3 rem time machine
4 rem solution by
5 rem jim speers
6 rem =================================
100 print"12[146] or 24[146] hour time?": input tm: if tm<>12 and tm<>24 then 100
110 b=1: e=12: f=720: if tm=24 then b=0: e=23: f=1440
120 print"[147]present time:[146]": (NULL)"0,.$"
130 print"hour";: input h: if h<b or h>e then 130
140 print"minute";: input m: if m<0 or m>59 then 140
150 tm=h*60+m: print"time difference(min)";: input d: t1=tm-d: t2=tm+d
160 if t1<0 then t1=t1+f: goto 160
170 if t2>f then t2=t2-f: goto 170
180 x=t1: gosub 200: print (NULL)"##:##";hr,mn
190 x=t2: gosub 200: print (NULL)"##:##";hr,mn: end
200 hr=int(x/60): mn=x-60*hr: if hr=0 and de=12 then hr=12
205 if hr=24 and e=23 then hr=0
210 return